import {defineStore} from 'pinia';
import {getApiAndVersion} from '@slc/api/slc/api';
import {
    savePzxxProtocol,
    upgradePzxxProtocol,
    saveSrcsProtocol,
    updateRowNotNullById,
    saveSccsProtocol,
    serviceInputData,
    serviceOutputData,
    getCsfbData,
    reqHeaderSearch,
    resHeaderSearch
} from '@slc/api/slc/inventory';
import * as capability from '@slc/views/slc/inventory/config/add';

import {flowServiceStore} from '@slc/store/flowService';

const store = flowServiceStore()


const initZhpzInfo = {
    originApiType: '2',
    inparamWithAttr: false,
    outparamWithAttr: false,
    isParamSerialize: false,
    isParamInSerialize: false,
    isParamOutSerialize: false,
    paramSerializeType: '1',
    paramInSerializeType: '1',
    paramOutSerializeType: '1',
    paramInSerializeName: 'text',
    paramOutSerializeName: 'text',
    isParamInChange: false,
    isParamOutChange: false,
};

const initPzxxInfo = {
    cateIds: [],
    serviceName: '',
    serviceCode: '',
    servicePath: '',
    serviceDesc: '',
    serviceType: '2',
    permType: '',
    mockUrl: '',
    httpRequestMethod: 'POST',
    limitCtrlStatus: false,
    limitCtrlParamval: '100',
    limitCtrlType: '1',
    alarmSecs: '0',
    timeoutSecs: '0',
    retryTimes: '',
    jmsDatasourceCode: '',
    jmsType: 'queue',
    jmsDestinationName: '',
    jmsRole: 'C',
};

const qqtInfo = {
    isHeaderInChange: false,
    isHeaderOutChange: false,
};

export const serviceStore = defineStore('service', {
    state: () => ({
        protocolTypeList: [],
        keyTypeList: [
            {dictValue: 'string', dictLabel: '字符串 (String)'},
            {dictValue: 'long', dictLabel: '整数 (Long)'},
            {dictValue: 'decimal', dictLabel: '小数 (Decimal)'},
            {dictValue: 'object', dictLabel: 'JSON对象 (Object)'},
            {dictValue: 'array', dictLabel: 'JSON数组 (Array)'},
        ],
        dialogStatus: 'add',
        dialogVersionStatus: '',
        serverReleaseType: '',
        visible: false,
        versionVisible: false,
        steps: [],
        curStep: 0,
        maxStep: 0,
        zhpzInfo: {...initZhpzInfo},
        chooseApiInfo: {},
        chooseSjjInfo: {},
        classifyList: [],
        pzxxInfo: {...initPzxxInfo},
        serviceVerId: '',
        reqHeaderList: [],
        resHeaderList: [],
        qqtInfo: {...qqtInfo},
        inputData: [],
        outputData: [],
        csInfo: {},
        csfbInfo: {},
        csfbTableData: [],
    }),
    actions: {
        // 选择注册方式
        chooseReleaseType(key) {
            this.setSteps(capability['steps' + key]);
        },

        // 获取生效API表格数据
        async getEffectiveApiData(query) {
            const params = {...query, apiStatus: 0}; // 默认查询已生效数据
            try {
                const res = await getApiAndVersion(params);
                if (res.code === '200') {
                    return res.data || {};
                }
                throw new Error('Failed to fetch data');
            } catch (error) {
                console.error(error);
                throw error;
            }
        },

        // 保存配置信息
        async doSavePzxxProtocol() {
            const {
                apiId,
                apiVerId,
                apiVersion,
                wsOpreation: mockOperation,
            } = this.chooseApiInfo;
            const {datasetId} = this.chooseSjjInfo;
            const {
                serviceName,
                servicePath,
                serviceDesc,
                limitCtrlStatus,
                limitCtrlParamval,
                limitCtrlType,
                httpRequestMethod,
                timeoutSecs,
                alarmSecs,
                retryTimes,
                jmsDatasourceCode,
                jmsType,
                jmsDestinationName,
                jmsRole,
                permType,
            } = this.pzxxInfo;
            const {
                isParamSerialize,
                isParamInSerialize,
                isParamOutSerialize,
                paramSerializeType,
                paramInSerializeType,
                paramOutSerializeType,
                paramInSerializeName,
                paramOutSerializeName
            } = this.zhpzInfo;
            const cateId = this.pzxxInfo.cateIds[this.pzxxInfo.cateIds.length - 1];

            let serviceType;
            let apiDomain;
            if (this.serverReleaseType === '1') {
                apiDomain = {apiId, apiVerId, apiVersion};
                serviceType = this.chooseApiInfo.apiType;
            } else {
                serviceType = this.pzxxInfo.serviceType;
            }

            const params = {
                datasetId,
                apiDomain,
                apiId,
                apiVerId,
                apiVersion,
                cateId,
                serviceName,
                servicePath,
                permType,
                httpRequestMethod,
                limitCtrlStatus: limitCtrlStatus ? '0' : '2',
                serviceDesc,
                limitCtrlParamval,
                limitCtrlType,
                timeoutSecs,
                alarmSecs,
                retryTimes,
                jmsDatasourceCode,
                jmsType,
                jmsDestinationName,
                jmsRole,
                serviceVerId: this.serviceVerId,
                serviceType,
                serverReleaseType: this.serverReleaseType,
                isParamSerialize: isParamSerialize ? 'Y' : 'N',
                isParamInSerialize: isParamInSerialize ? 'Y' : 'N',
                isParamOutSerialize: isParamOutSerialize ? 'Y' : 'N',
                paramSerializeType,
                paramInSerializeType,
                paramOutSerializeType,
                paramInSerializeName,
                paramOutSerializeName
            };

            try {
                const fn = this.dialogVersionStatus === 'upgrade' ? upgradePzxxProtocol : savePzxxProtocol;
                const res = await fn(params);
                if (res.code === '200') {
                    let serviceVerId;
                    if (this.serverReleaseType === '2' || this.serverReleaseType === '9' || this.serverReleaseType === '5') {
                        const {mockUrl, serviceCode} = res.data;
                        // this.$patch({
                        //     serviceVerId: res.data.serviceVerId
                        // });
                        this.serviceVerId =res.data.serviceVerId
                        // Commit mock service data if necessary

                        store.setServiceDomain({mockUrl, serviceCode});
                    } else {
                        serviceVerId = res.data;
                        // this.$patch({
                        //     serviceVerId
                        // });
                        this.serviceVerId = serviceVerId

                    }

                    if (this.serverReleaseType === '2' || this.serverReleaseType === '3') {
                        // Fetch header data for protocol conversion
                        await this.getReqHeaderData({serviceVerId});
                        await this.getResHeaderData({serviceVerId});
                    }
                }
            } catch (error) {
                console.error('Error saving configuration:', error);
            }
        },

        // 查询请求头
        async getReqHeaderData(params) {
            const res = await reqHeaderSearch(params);
            this.setReqHeaderList(res.data || []);
        },

        // 响应头参数
        async getResHeaderData(params) {
            const res = await resHeaderSearch(params);
            this.setResHeaderList(res.data || []);
        },

        // 获取输入参数
        async getInputData(query = {}) {
            const res = await serviceInputData(query);
            if (res.code === '200') {
                this.setInputData(res.data);
            }
        },

        // 获取输出参数
        async getOutputData(query = {}) {
            const res = await serviceOutputData(query);
            if (res.code === '200') {
                this.setOutputData(res.data);
            }
        },

        // 保存输入或者输出参数
        async doSaveSrcsOrSccsProtocol() {
            let list, fn, params;
            if (this.steps[this.curStep].key === 'SRCS') {
                list = this.inputData;
                fn = saveSrcsProtocol;
                params = {serviceVerId: this.serviceVerId, paramInSerializeName: this.zhpzInfo.paramInSerializeName};
            } else if (this.steps[this.curStep].key === 'SCCS') {
                list = this.outputData;
                fn = saveSccsProtocol;
                params = {serviceVerId: this.serviceVerId, paramOutSerializeName: this.zhpzInfo.paramOutSerializeName};
            }

            if (this.zhpzInfo.isParamInSerialize) {
                await updateRowNotNullById(params);
            }
            if (this.zhpzInfo.isParamOutSerialize) {
                await updateRowNotNullById(params);
            }
        },

        // 获取测试/发布的数据
        async getCsfbInfo(query) {
            const res = await getCsfbData(query);
            const {data = {}} = res;
            const {connServiceParamInList = []} = data;
            this.setCsfbInfo(data);
            this.setCsfbTableData(connServiceParamInList);
        },

        // Helper methods for committing data (since Pinia does not use mutations directly)
        setSteps(steps) {
            this.steps = steps;
        },
        setCurStep(data) {
            this.curStep = data
        },
        setMaxStep(data) {
            this.maxStep = data
        },
        setZhpzInfo(data) {
            this.zhpzInfo = data
        },
        setChooseApiInfo(data) {
            this.chooseApiInfo = data
        },
        setChooseSjjInfo(data) {
            this.chooseSjjInfo = data
        },
        setClassifyList(data) {
            this.classifyList = data
        },
        setPzxxInfo(data) {
            this.pzxxInfo = data
        },
        setServiceVerId(data) {
            this.serviceVerId = data
        },

        setProtocolTypeList(data) {
            this.protocolTypeList = data
        },
        setKeyTypeList(data) {
            this.keyTypeList = data
        },
        setDialogStatus(data) {
            this.dialogStatus = data
        },
        setDialogVersionStatus(data) {
            this.dialogVersionStatus = data
        },
        setServerReleaseType(data) {
            this.serverReleaseType = data
        },
        setVisible(data) {
            this.visible = data
        },
        setVersionVisible(data) {
            this.versionVisible = data
        },
        setQqtInfo(data) {
            this.qqtInfo = data
        },

        // setServiceDomain(domain) {
        // },
        setReqHeaderList(list) {
            this.reqHeaderList = list;
        },
        setResHeaderList(list) {
            this.resHeaderList = list;
        },
        setInputData(data) {
            this.inputData = data;
        },
        setOutputData(data) {
            this.outputData = data;
        },
       setCsInfo(data) { // 测试信息
        this.csInfo = data
        },
        setCsfbInfo(data) {
            this.csfbInfo = data;
        },
        setCsfbTableData(data) {
            this.csfbTableData = data;
        },

      doVersionClear() {
        this.dialogVersionStatus = ''
          this.steps = []
          this.curStep = 0
          this.maxStep = 0
          this.chooseApiInfo = {}
          this.chooseSjjInfo = {}
          this.zhpzInfo = {...initZhpzInfo}
          this.pzxxInfo = {...initPzxxInfo}
          this.reqHeaderList = []
          this.resHeaderList = []
          this.serviceVerId = ''
          this.qqtInfo = {...qqtInfo}
          this.inputData = []
          this.outputData = []
          this.csInfo = {} // 测试信息
          this.csfbInfo = {}
          this.csfbTableData = []
    },
    doClear() {
        this.dialogStatus = 'add'
        this.serverReleaseType = ''
        this.dialogVersionStatus = ''
        this.curStep = 0
        this.maxStep = 0
        this.chooseApiInfo = {}
        this.chooseSjjInfo = {}
        this.zhpzInfo = {...initZhpzInfo}
        this.pzxxInfo = {...initPzxxInfo}
        this.reqHeaderList = []
        this.resHeaderList = []
        this.serviceVerId = ''
        this.qqtInfo = {...qqtInfo}
        this.inputData = []
        this.outputData = []
        this.csfbInfo = {}
        this.csInfo = {} // 测试信息
        this.csfbTableData = []
        this.steps = []
        this.visible=false
    }

    },
    getters: {
        // getProtocolTypeList: (state) => state.protocolTypeList,
        // getKeyTypeList: (state) => state.keyTypeList,
        // getSteps: (state) => state.steps,
        // getZhpzInfo: (state) => state.zhpzInfo,
        // getPzxxInfo: (state) => state.pzxxInfo,
    },
});


// import { getApiAndVersion } from '@/api/conn/api';
// import {
//     savePzxxProtocol,
//     upgradePzxxProtocol,
//     saveSrcsProtocol,
//     updateRowNotNullById,
//     saveSccsProtocol,
//     serviceInputData,
//     serviceOutputData,
//     getCsfbData,
//     reqHeaderSearch,
//     resHeaderSearch
// } from '@/api/conn/capability/inventory';
// import * as capability from '@/views/conn/capability/inventory/config/add';
// const initZhpzInfo = {
//     originApiType: '2', // 源api类型
//     inparamWithAttr: false, // 输入参数 支持参数属性
//     outparamWithAttr: false, // 输出参数 支持参数属性
//     isParamSerialize: false, // 出入入参数序列化
//     isParamInSerialize: false, // 入参数序列化
//     isParamOutSerialize: false, // 出参数序列化
//     paramSerializeType: '1', // 序列化类型  1=XML,  2=JSON
//     paramInSerializeType: '1', // 序列化类型  1=XML,  2=JSON
//     paramOutSerializeType: '1', // 序列化类型  1=XML,  2=JSON
//     paramInSerializeName: 'text', // 入参名称
//     paramOutSerializeName: 'text', // 出参名称
//     isParamInChange: false, // 输入参数转换结构
//     isParamOutChange: false, // 输出参数转换结构
// }
// const initPzxxInfo = {
//     cateIds: [], // 所属分类
//     serviceName: '', // 能力名称
//     serviceCode: '', // 能力编码
//     servicePath: '', //能力别名
//     serviceDesc: '', // 能力描述
//     serviceType: '2', // 能力类型
//     permType: '', // 能力权限
//     mockUrl: '', // 请求路径
//     httpRequestMethod: 'POST', // 请求方式：
//     limitCtrlStatus: false, // 限流开关
//     limitCtrlParamval: '100', // 限流阀值
//     limitCtrlType: '1', // 限流方式  1=QPS 2=线程数
//     alarmSecs: '0', // 预警响应时间
//     timeoutSecs: '0', // 超时时间
//     retryTimes: '', // 失败重试次数
//     jmsDatasourceCode: '', // JMS数据源
//     jmsType: 'queue', // 消息类型
//     jmsDestinationName: '', // Queue名称/Topic名称
//     jmsRole: 'C' // JMS角色
// }
// const qqtInfo = {
//     isHeaderInChange: false,
//     isHeaderOutChange: false
// }
//
// const state = {
//     protocolTypeList: [], // 能力方式类型集合
//     keyTypeList: [
//         { "dictValue": "string", "dictLabel": "字符串 (String)" },
//         { "dictValue": "long", "dictLabel": "整数 (Long)" },
//         { "dictValue": "decimal", "dictLabel": "小数 (Decimal)" },
//         { "dictValue": "object", "dictLabel": "JSON对象 (Object)" },
//         { "dictValue": "array", "dictLabel": "JSON数组 (Array)" }
//     ], // 参数类型集合
//     dialogStatus: 'add', // 新增add 编辑edit
//     dialogVersionStatus: '',
//     serverReleaseType: '', // 1=API直连,2=复合编排,3=协议转换,4=数据接口,9=专家模式
//     visible: false,
//     versionVisible: false,
//     steps: [], // 步骤
//     curStep: 0, // 当前第几步
//     maxStep: 0, // 最大步数，只能之前的步骤
//     zhpzInfo: {...initZhpzInfo}, // 转换配置数据
//     chooseApiInfo: {}, // 选择的api数据
//     chooseSjjInfo: {}, // 选择的数据集数据
//     classifyList: [], // 分类数据
//     pzxxInfo: {...initPzxxInfo}, // 配置信息组件数据
//     serviceVerId: '', // 保存配置信息接口返回的VerId,如果返回之前的步骤修改，VerId存在则需要传入
//     reqHeaderList: [], // 请求头参数
//     resHeaderList: [], // 响应头参数
//     qqtInfo: {...qqtInfo}, // 请求头响应数据
//     inputData: [], // 输入参数表格数据
//     outputData: [], // 输出参数表格数据
//     csInfo: {}, // 测试信息
//     csfbInfo: {}, // 测试发布数据
//     csfbTableData: [], // 测试发布表格数据
// }
//
// const mutations = {
//     setProtocolTypeList(data) {
//         state.protocolTypeList = data
//     },
//     setKeyTypeList(data) {
//         state.keyTypeList = data
//     },
//     setDialogStatus(data) {
//         state.dialogStatus = data
//     },
//     setDialogVersionStatus(data) {
//         state.dialogVersionStatus = data
//     },
//     setServerReleaseType(data) {
//         state.serverReleaseType = data
//     },
//     setVisible(data) {
//         state.visible = data
//     },
//     setVersionVisible(data) {
//         state.versionVisible = data
//     },
//     setSteps(data) {
//         state.steps = data
//     },
//     setCurStep(data) {
//         state.curStep = data
//     },
//     setMaxStep(data) {
//         state.maxStep = data
//     },
//     setZhpzInfo(data) {
//         state.zhpzInfo = data
//     },
//     setChooseApiInfo(data) {
//         state.chooseApiInfo = data
//     },
//     setChooseSjjInfo(data) {
//         state.chooseSjjInfo = data
//     },
//     setClassifyList(data) {
//         state.classifyList = data
//     },
//     setPzxxInfo(data) {
//         state.pzxxInfo = data
//     },
//     setServiceVerId(data) {
//         state.serviceVerId = data
//     },
//     setReqHeaderList(data) {
//         state.reqHeaderList = data
//     },
//     setResHeaderList(data) {
//         state.resHeaderList = data
//     },
//     setQqtInfo(data) {
//         state.qqtInfo = data
//     },
//     setInputData(data) {
//         state.inputData = data
//     },
//     setOutputData(data) {
//         state.outputData = data
//     },
//     setCsInfo(data) { // 测试信息
//         state.csInfo = data
//     },
//     setCsfbInfo(data) {
//         state.csfbInfo = data
//     },
//     setCsfbTableData(data) {
//         state.csfbTableData = data
//     },
//     doVersionClear(state) {
//         state.dialogVersionStatus = ''
//         state.steps = []
//         state.curStep = 0
//         state.maxStep = 0
//         state.chooseApiInfo = {}
//         state.chooseSjjInfo = {}
//         state.zhpzInfo = {...initZhpzInfo}
//         state.pzxxInfo = {...initPzxxInfo}
//         state.reqHeaderList = []
//         state.resHeaderList = []
//         state.serviceVerId = ''
//         state.qqtInfo = {...qqtInfo}
//         state.inputData = []
//         state.outputData = []
//         state.csInfo = {} // 测试信息
//         state.csfbInfo = {}
//         state.csfbTableData = []
//     },
//     doClear(state) {
//         state.dialogStatus = 'add'
//         state.serverReleaseType = ''
//         state.dialogVersionStatus = ''
//         state.steps = []
//         state.curStep = 0
//         state.maxStep = 0
//         state.chooseApiInfo = {}
//         state.chooseSjjInfo = {}
//         state.zhpzInfo = {...initZhpzInfo}
//         state.pzxxInfo = {...initPzxxInfo}
//         state.reqHeaderList = []
//         state.resHeaderList = []
//         state.serviceVerId = ''
//         state.qqtInfo = {...qqtInfo}
//         state.inputData = []
//         state.outputData = []
//         state.csfbInfo = {}
//         state.csInfo = {} // 测试信息
//         state.csfbTableData = []
//     }
// }
//
// const actions = {
//     // 选择注册方式
//     chooseReleaseType({ commit }, key) {
//         // key: 1=API直连,2=复合编排,3=协议转换,4=数据接口,9=专家模式
//         // const arr = [ steps1, steps2, steps3, steps3, steps9]
//         // commit('setSteps', arr[+key - 1])
//         commit('setSteps', capability['steps'+key])
//     },
//     // 获取生效API表格数据
//     getEffectiveApiData ({ commit }, query) {
//         return new Promise(async (resolve, reject) => {
//             const params = {
//                 ...query,
//                 apiStatus: 0, // 默认查询已生效数据
//             }
//             const res = await getApiAndVersion(params)
//             if (res.code === '200') {
//                 resolve(res.data || {})
//             } else {
//                 reject()
//             }
//         })
//     },
//
//     // 保存配置信息
//     async doSavePzxxProtocol({ state, commit, dispatch }) {
//         const {
//             apiId,
//             apiVerId,
//             apiVersion,
//             wsOpreation: mockOperation,
//         } = state.chooseApiInfo
//         const { datasetId } = state.chooseSjjInfo
//         const {
//             serviceName,
//             servicePath,
//             serviceDesc,
//             limitCtrlStatus,
//             limitCtrlParamval,
//             limitCtrlType,
//             httpRequestMethod,
//             timeoutSecs,
//             alarmSecs,
//             retryTimes,
//             jmsDatasourceCode,
//             jmsType,
//             jmsDestinationName,
//             jmsRole,
//             permType,
//         } = state.pzxxInfo
//         const {
//             isParamSerialize,
//             isParamInSerialize,
//             isParamOutSerialize,
//             paramSerializeType,
//             paramInSerializeType,
//             paramOutSerializeType,
//             paramInSerializeName,
//             paramOutSerializeName
//         } = state.zhpzInfo
//         const cateId = state.pzxxInfo.cateIds[state.pzxxInfo.cateIds.length - 1]
//         let serviceType
//         let apiDomain
//         // return
//         if (state.serverReleaseType === '1') {
//             apiDomain = {
//                 apiId,
//                 apiVerId,
//                 apiVersion,
//             }
//             serviceType = state.chooseApiInfo.apiType
//         } else {
//             serviceType = state.pzxxInfo.serviceType
//         }
//         const params = {
//             datasetId,
//             apiDomain,
//             apiId,
//             apiVerId,
//             apiVersion,
//             cateId,
//             serviceName,
//             servicePath,
//             permType,
//             httpRequestMethod,
//             limitCtrlStatus: limitCtrlStatus ? '0' : '2',
//             serviceDesc,
//             limitCtrlParamval,
//             limitCtrlType,
//             timeoutSecs,
//             alarmSecs,
//             retryTimes,
//             jmsDatasourceCode,
//             jmsType,
//             jmsDestinationName,
//             jmsRole,
//             serviceVerId: state.serviceVerId,
//             serviceType,
//             // mockOperation, 暂时不需要此参数
//             serverReleaseType: state.serverReleaseType,
//             isParamSerialize: isParamSerialize ? 'Y' : 'N',
//             isParamInSerialize: isParamInSerialize ? 'Y' : 'N',
//             isParamOutSerialize: isParamOutSerialize ? 'Y' : 'N',
//             paramSerializeType,
//             paramInSerializeType,
//             paramOutSerializeType,
//             paramInSerializeName,
//             paramOutSerializeName
//         }
//         let fn
//         if (state.dialogVersionStatus === 'upgrade') {
//             fn = upgradePzxxProtocol
//         } else {
//             fn = savePzxxProtocol
//         }
//         const res = await fn(params)
//         if (res.code === '200') {
//             let serviceVerId
//             if (state.serverReleaseType === '2'||state.serverReleaseType === '9'||state.serverReleaseType === '5') {
//                 const { mockUrl, serviceCode } = res.data
//                 commit('flowService/setServiceDomain', { mockUrl, serviceCode }, { root: true })
//                 serviceVerId = res.data.serviceVerId
//             } else {
//                 serviceVerId = res.data
//             }
//             commit('setServiceVerId', serviceVerId)
//             if (state.serverReleaseType === '2' || state.serverReleaseType === '3') { // 协议转换
//                 dispatch('getReqHeaderData', { serviceVerId })
//                 dispatch('getResHeaderData', { serviceVerId })
//             }
//         }
//     },
//     // 查询请求头
//     async getReqHeaderData({ commit }, params) {
//         const res = await reqHeaderSearch(params)
//         commit('setReqHeaderList', res.data || [])
//     },
//     //响应头参数
//     async getResHeaderData({ commit }, params) {
//         const res = await resHeaderSearch(params)
//         commit('setResHeaderList', res.data || [])
//     },
//     // 获取输入参数
//     async getInputData({ state, commit }, query = {}) {
//         const res = await serviceInputData(query)
//         if (res.code === '200') {
//             commit('setInputData', res.data)
//         }
//     },
//     // 获取输出参数
//     async getOutputData({ commit }, query = {}) {
//         const res = await serviceOutputData(query)
//         if (res.code === '200') {
//             commit('setOutputData', res.data)
//         }
//     },
//     // 保存输入或者输出参数
//     async doSaveSrcsOrSccsProtocol({ state }) {
//         let list, fn, params
//         if (state.steps[state.curStep].key === 'SRCS') {
//             list = state.inputData
//             fn = saveSrcsProtocol
//             params = {
//                 serviceVerId: state.serviceVerId,
//                 paramInSerializeName: state.zhpzInfo.paramInSerializeName
//             }
//         } else if (state.steps[state.curStep].key === 'SCCS') {
//             list = state.outputData
//             fn = saveSccsProtocol
//             params = {
//                 serviceVerId: state.serviceVerId,
//                 paramOutSerializeName: state.zhpzInfo.paramOutSerializeName
//             }
//         }
//         // 操作列隐藏和重命名暂时不需要，所有不调保存接口
//         // await fn({ list })
//         // 如果序列化参数，则保存配置属性
//         if (state.zhpzInfo.isParamInSerialize) {
//             await updateRowNotNullById(params)
//         }
//         if (state.zhpzInfo.isParamOutSerialize) {
//             await updateRowNotNullById(params)
//         }
//     },
//     // 获取测试/发布的数据
//     async getCsfbInfo({ commit }, query) {
//         const res = await getCsfbData(query)
//       console.log("<<<<<<<<<<<11<<<<<<<<<<<<<")
//         const { data = {} } = res
//         const { connServiceParamInList = [] } = data
//         commit('setCsfbInfo', data)
//       console.log(data);
//         commit('setCsfbTableData', connServiceParamInList)
//     }
// }
//
// export default {
//     namespaced: true,
//     state,
//     mutations,
//     actions
// }
